package com.hadoop.mr.amiudake.flow;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class FlowBean implements Writable{
	private String phone;
	private String area;
	private String name;
	private Long flow;
	
	
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Long getFlow() {
		return flow;
	}
	public void setFlow(Long flow) {
		this.flow = flow;
	}
	/**
	 * 
	 */
	@Override
	public void write(DataOutput out) throws IOException {
		out.writeUTF(this.phone);
		out.writeUTF(this.area);
		out.writeUTF(this.name);
		out.writeLong(this.flow);
	}
	
	@Override
	public void readFields(DataInput in) throws IOException {
		this.phone = in.readUTF();
		this.area = in.readUTF();
		this.name = in.readUTF();
		this.flow = in.readLong();
	}
	
	@Override
	public String toString() {
		return "Flow [phone=" + phone + ", addr=" + area + ", name=" + name + ", flow=" + flow + "]";
	}
}
